//
//  DHCustomButtonVC.m
//  NavigationDemo
//
//  Created by 商广硕 on 2022/7/9.
//

#import "DHCustomButtonVC.h"
#import "DHButton.h"
#import "DHAlert.h"
@interface DHCustomButtonVC ()

@end

@implementation DHCustomButtonVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
  
        DHButton *customerButton = [[DHButton alloc] initWithFrame:CGRectMake(10, 100, 100, 100)];
            customerButton.customTitle = @"点击变红";
            customerButton.customRadius=16;
            customerButton.customBorderColorr = [UIColor redColor];

            [self.view addSubview:customerButton];
    DHButton *customerButton1 = [[DHButton alloc] initWithFrame:CGRectMake(120, 100, 100, 100)];
        customerButton1.customTitle = @"测试";
        customerButton1.customImage = @"image_face_eye";
        customerButton1.customBorder        = 2;
        customerButton1.customButtonType = CustomButtonTypeRight;
        customerButton1.customBackgroundColor=[UIColor redColor];
            customerButton1.customRadius=16;
    customerButton1.customBorderColorr = [UIColor redColor];
        [self.view addSubview:customerButton1];
    //点击事件
    [customerButton addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
    
}

-(IBAction)onClick:(DHButton *)button{
    button.customBackgroundColor=[UIColor redColor];
    NSLog(@"点击");
    [self alert];
}
-(void)alert{
    DHAlert *alert= [DHAlert showAlert:@"" Cancle:^{
        NSLog(@"弹窗--取消按钮------");
    }];
    
    [self.view addSubview:alert];
    
}
-(void)onAlert{
    NSLog(@"弹窗--取消按钮------");
    
}
@end
